home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Franz PD / Franz PD Disk #279 (1993)(Rhein-Sieg-Soft).zip / Franz PD Disk #279 (1993)(Rhein-Sieg-Soft).adf / ak_gen0-lib_V38.20.LHA / ak_gen0-library / Programmers.LHA / Programmers / Examples / ShowModes.c < prev    next >
C/C++ Source or Header  |  1993-06-26  |  2KB  |  60 lines

  1.  
  2.  /* ShowModes V37.83                                           */
  3.  /* FREEWARE.                                                  */
  4.  /* (c) 1993 by Andreas R. Kleinert.                           */
  5.  /* Demonstrates use of the "ak_gen0.library"'s ModeList.      */
  6.  /* Written in SAS/C V6.00 for OS V2.04 (V37) Includes.        */
  7.  
  8. #include <ak_gen0/ak_gen0_pragma.h>
  9.  
  10. #include <proto/exec.h>
  11. #include <proto/dos.h>
  12.  
  13. #include <stdio.h>
  14. #include <stdlib.h>
  15. #include <string.h>
  16.  
  17. void main(long argc, char **argv)
  18. {
  19.  struct List         *modelist = N;
  20.  struct AK_ModeEntry *selmode  = N;
  21.  
  22.  printf("\nShowModes V37.83, FREEWARE, (c) 1993 by Andreas R. Kleinert.\n");
  23.  
  24.  AKBase = (struct AKBase *) OpenLibrary("ak_gen0.library", 37); /* minimum */
  25.  if(AKBase)
  26.   {
  27.    modelist = (struct List *) AK_GetModeList();
  28.    if(modelist)
  29.     {
  30.      for(selmode=(APTR)modelist->lh_Head;(selmode)&&(selmode!=(APTR) &(modelist->lh_Tail));)
  31.       {
  32.        printf("\n Modus-Name     : %s",           selmode->ModeName);
  33.        printf("\n     Dimensions : max. %ldx%ld", selmode->StandardWidth,
  34.                                                    selmode->StandardHeight);
  35.        printf("\n     OverScan   : max. %ldx%ld", selmode->MaxWidth,
  36.                                                    selmode->MaxHeight);
  37.        printf("\n     MaxColors  : max. %ld    ", 1<<selmode->MaxDepth);
  38.   
  39.        selmode = (APTR) selmode->ModeNode.ln_Succ;
  40.       }
  41.  
  42.      printf("\n\n No more information.\n");
  43.  
  44.      AK_FreeModeList((APTR) modelist);
  45.     }else
  46.     {
  47.      printf("\n Attempt to create Mode-List failed.\n");
  48.     }
  49.  
  50.    CloseLibrary((APTR) AKBase);
  51.   }else
  52.   {
  53.    printf("\n Can't open \42ak_gen0.library\42 V37+ !\n");
  54.   }
  55.  
  56.  CloseLibrary((APTR) IntuitionBase);
  57.  
  58.  exit(0);
  59. }
  60.